<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<f:view>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
            <title>Global Image - Criar novo us&aacute;rio</title>
            <link rel="stylesheet" type="text/css" href="/globalimage2/faces/jsfcrud.css" /><%@ include file="/WEB-INF/jspf/AjaxScripts.jspf" %><script type="text/javascript" src="/globalimage2/faces/jsfcrud.js"></script>
        </head>
        <body>
            <%@include file="../../WEB-INF/jspf/header/head.jspf"%>
            <div style="float:left">
                <%@include file="../../WEB-INF/jspf/header/menuDinamico.jspf"%>
            </div>
            <div id="div_content">
                <h:form>
                    <h3>Criar novo usu&aacute;rio</h3>

                    <h:commandLink action="#{usuario.create}" value="Salvar"/>&nbsp;|&nbsp;<h:commandLink action="#{usuario.listSetup}" value="Exibir todos" immediate="true"/>

                    <h:panelGroup id="messagePanel" layout="block">
                        <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
                    </h:panelGroup>


                    <h:inputHidden id="validateCreateField" validator="#{usuario.validateCreate}" value="value"/>
                    <h:panelGrid columns="2">
                        <h:outputText value="Nome:"/>
                        <h:inputText id="nome" value="#{usuario.usuario.nome}" title="Nome" maxlength="254" size="50" required="true" requiredMessage="The nome field is required." />
                        <h:outputText value="Email:"/>
                        <h:inputText id="email" value="#{usuario.usuario.email}" maxlength="254" size="50" title="Email" required="true" requiredMessage="The email field is required." />
                        <h:outputText value="Empresa:"/>
                        <h:selectOneMenu id="empresaId" value="#{usuario.usuario.empresaId}" title="EmpresaId" required="true" requiredMessage="The empresaId field is required." >
                            <f:selectItems value="#{empresa.empresaItemsAvailableSelectOne}"/>
                        </h:selectOneMenu>
                        <h:outputText value="Tipo de Usuário:"/>
                        <h:selectOneMenu id="tipoUsuarioId" value="#{usuario.usuario.tipoUsuarioId}" title="TipoUsuarioId" required="true" requiredMessage="The tipoUsuarioId field is required." >
                            <f:selectItems value="#{tipoUsuario.tipoUsuarioItemsAvailableSelectOne}"/>
                        </h:selectOneMenu>
                        <h:outputText value="Senha:"/>
                        <h:inputSecret id="senha" maxlength="8" size="8" value="#{usuario.usuario.senha}" title="Senha" required="true" requiredMessage="The senha field is required." />

                        <h:outputText value="Telefone:"/>
                        <h:panelGrid columns="3">
                            <h:inputText id="dddi1" maxlength="2" size="2" value="#{usuario.usuario.dddi1}" title="Dddi1" required="true" requiredMessage="The dddi1 field is required." />
                            <h:inputText id="ddd1" value="#{usuario.usuario.ddd1}" maxlength="2" size="2" title="Ddd1" required="true" requiredMessage="The ddd1 field is required." />
                            <h:inputText id="numero1"  maxlength="8" size="8" value="#{usuario.usuario.numero1}" title="Numero1" required="true" requiredMessage="The numero1 field is required." />
                        </h:panelGrid>

                        <h:outputText value="Celular:"/>
                        <h:panelGrid columns="3">
                            <h:inputText id="ddi2" value="#{usuario.usuario.ddi2}" maxlength="2" size="2" title="Ddi2" />
                            <h:inputText id="ddd2" value="#{usuario.usuario.ddd2}" maxlength="2" size="2" title="Ddd2" />
                            <h:inputText id="numero2" maxlength="8" size="8" value="#{usuario.usuario.numero2}" title="Numero2" />
                        </h:panelGrid>

                        <h:outputText value="Outro:"/>
                        <h:panelGrid columns="3">
                            <h:inputText id="ddi3" value="#{usuario.usuario.ddi3}" maxlength="2" size="2" title="Ddi3" />
                            <h:inputText id="ddd3" value="#{usuario.usuario.ddd3}" maxlength="2" size="2" title="Ddd3" />
                            <h:inputText id="numero3" maxlength="8" size="8" value="#{usuario.usuario.numero3}" title="Numero3" />
                        </h:panelGrid>
                    </h:panelGrid>
                </h:form>
            </div>
        </body>
    </html>
</f:view>
